package cn.edu.gench.learn.day4.war3;

/**
 * Created by Administrator on 2017/3/31.
 */
public class AmHero extends Hero{

    private int attack = 60;


    public AmHero() {
        this.blood = 100;
        this.magic = 200;
        Skills skills = new Skills();
        skills.setWaste(10);
        skills.setHurt(30);
        skills.setName("暴风雪");
        this.skills = skills;

    }

    public void fight(JuggHero juggHero){
        this.magic = this.magic - skills.getWaste();
        if(this.magic < skills.getWaste()){
            juggHero.blood =  juggHero.blood  - this.attack;
        }else{
            juggHero.blood =  juggHero.blood  - skills.getHurt();
        }

        if(juggHero.blood <= 0){
            System.out.println("juggHero die");
        }
    }

    @Override
    public String toString() {
        System.out.println("blood:"+ blood);
        System.out.println("magic:"+ magic);
        return "AmHero{}";
    }
}
